var api;
// 暴露出去的服务接口价均价
api = {
  post: function (param, callback) {
    wx.showLoading({
      title: '加载中...',
    })
    wx.request({
      url: param.url,
      method: 'post',
      dataType: "json",
      data:param.data,
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (e) {
        wx.hideLoading();
        callback(e.data);
      },
      fail: function (e) {
        wx.hideLoading();
        callback();
      }
    });
  },
  doget: function (url, callback) {
    wx.showLoading({
      title: '加载中...',
    })
    wx.request({
      url: url,
      method: 'get',
      dataType: "json",
      header: {
        'Content-Type': 'application/json'
      },
      success: function (e) {
        wx.hideLoading();
        callback(e.data);
      },
      fail: function (e) {
        wx.hideLoading();
        callback();
      }
    });
  }
}
module.exports = api;